xend: Pass information to user when failing migrate due to PCI dev.
authorKeir Fraser <keir@xensource.com>
Sun, 1 Jul 2007 21:10:38 +0000 (22:10 +0100)
committerKeir Fraser <keir@xensource.com>
Sun, 1 Jul 2007 21:10:38 +0000 (22:10 +0100)
When failing a migration / save due to the domain owning a PCI device
make sure that we tell the user what went wrong!

Signed-off-by: Mark Williamson <mark.williamson@cl.cam.ac.uk>
tools/python/xen/xend/XendCheckpoint.py
tools/python/xen/xend/XendDomain.py

index 2cfc06a2dbe234b5c397a668bc36ae63395e5976..1aa7d7f69de69fc614b6edbcc173721f7a3e1cae 100644 (file)
@@ -148,6 +148,8 @@ def save(fd, dominfo, network, live, dst, checkpoint=False):
         except:
             log.exception("Failed to reset the migrating domain's name")
 
+        raise exn
+
 
 def restore(xd, fd, dominfo = None, paused = False):
     signature = read_exact(fd, len(SIGNATURE),
index 4d082a5ac963e407e4942d8d2195fe8ada9af6bf..bca5830185641b9ee83a1338f0f38e51fcd75ad1 100644 (file)
@@ -1262,8 +1262,10 @@ class XendDomain:
             try:
                 XendCheckpoint.save(fd, dominfo, False, False, dst,
                                     checkpoint=checkpoint)
-            finally:
+            except Exception, e:
                 os.close(fd)
+                raise e
+            os.close(fd)
         except OSError, ex:
             raise XendError("can't write guest state file %s: %s" %
                             (dst, ex[1]))